﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System.Configuration;

namespace MySoft.Learning.Unity.Test
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            UnityContainer myContainer = new UnityContainer();
            UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
            //section.
            //UnityConfigurationSection
            myContainer.RegisterType<IUser,User>();
            //section.Configure(myContainer, "defaultContainer");

            IUser userAppService = myContainer.Resolve<IUser>();
            bool isTrue = userAppService.IsAuthorized("a");
            Assert.AreEqual(true, isTrue);
        }
    }
}
